\(\int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx\) [183]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 75 \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=\frac {4 x}{a^3}+\frac {4 i \log (\sin (c+d x))}{a^3 d}-\frac {4 i \log (\tan (c+d x))}{a^3 d}-\frac {3 \tan (c+d x)}{a^3 d}+\frac {i \tan ^2(c+d x)}{2 a^3 d} \]

[Out]

4*x/a^3+4*I*ln(sin(d*x+c))/a^3/d-4*I*ln(tan(d*x+c))/a^3/d-3*tan(d*x+c)/a^3/d+1/2*I*tan(d*x+c)^2/a^3/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3167, 862, 90} \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=\frac {i \tan ^2(c+d x)}{2 a^3 d}-\frac {3 \tan (c+d x)}{a^3 d}+\frac {4 i \log (\sin (c+d x))}{a^3 d}-\frac {4 i \log (\tan (c+d x))}{a^3 d}+\frac {4 x}{a^3} \]

[In]

Int[Sec[c + d*x]^3/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^3,x]

[Out]

(4*x)/a^3 + ((4*I)*Log[Sin[c + d*x]])/(a^3*d) - ((4*I)*Log[Tan[c + d*x]])/(a^3*d) - (3*Tan[c + d*x])/(a^3*d) +
 ((I/2)*Tan[c + d*x]^2)/(a^3*d)

Rule 90

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 862

Int[((d_) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[(d + e*x)
^(m + p)*(f + g*x)^n*(a/d + (c/e)*x)^p, x] /; FreeQ[{a, c, d, e, f, g, m, n}, x] && NeQ[e*f - d*g, 0] && EqQ[c
*d^2 + a*e^2, 0] && (IntegerQ[p] || (GtQ[a, 0] && GtQ[d, 0] && EqQ[m + p, 0]))

Rule 3167

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symb
ol] :> Dist[-d^(-1), Subst[Int[x^m*((b + a*x)^n/(1 + x^2)^((m + n + 2)/2)), x], x, Cot[c + d*x]], x] /; FreeQ[
{a, b, c, d}, x] && IntegerQ[n] && IntegerQ[(m + n)/2] && NeQ[n, -1] &&  !(GtQ[n, 0] && GtQ[m, 1])

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{x^3 (i a+a x)^3} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \frac {\left (-\frac {i}{a}+\frac {x}{a}\right )^2}{x^3 (i a+a x)} \, dx,x,\cot (c+d x)\right )}{d} \\ & = -\frac {\text {Subst}\left (\int \left (\frac {i}{a^3 x^3}-\frac {3}{a^3 x^2}-\frac {4 i}{a^3 x}+\frac {4 i}{a^3 (i+x)}\right ) \, dx,x,\cot (c+d x)\right )}{d} \\ & = \frac {4 x}{a^3}+\frac {4 i \log (\sin (c+d x))}{a^3 d}-\frac {4 i \log (\tan (c+d x))}{a^3 d}-\frac {3 \tan (c+d x)}{a^3 d}+\frac {i \tan ^2(c+d x)}{2 a^3 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.12 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.64 \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=\frac {i \left (-4 \log (i-\tan (c+d x))+3 i \tan (c+d x)+\frac {1}{2} \tan ^2(c+d x)\right )}{a^3 d} \]

[In]

Integrate[Sec[c + d*x]^3/(a*Cos[c + d*x] + I*a*Sin[c + d*x])^3,x]

[Out]

(I*(-4*Log[I - Tan[c + d*x]] + (3*I)*Tan[c + d*x] + Tan[c + d*x]^2/2))/(a^3*d)

Maple [A] (verified)

Time = 0.76 (sec) , antiderivative size = 41, normalized size of antiderivative = 0.55

method result size
derivativedivides \(\frac {-3 \tan \left (d x +c \right )+\frac {i \tan \left (d x +c \right )^{2}}{2}-4 i \ln \left (\tan \left (d x +c \right )-i\right )}{d \,a^{3}}\) \(41\)
default \(\frac {-3 \tan \left (d x +c \right )+\frac {i \tan \left (d x +c \right )^{2}}{2}-4 i \ln \left (\tan \left (d x +c \right )-i\right )}{d \,a^{3}}\) \(41\)
risch \(\frac {8 x}{a^{3}}+\frac {8 c}{d \,a^{3}}-\frac {2 i \left (2 \,{\mathrm e}^{2 i \left (d x +c \right )}+3\right )}{a^{3} d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {4 i \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d \,a^{3}}\) \(73\)
norman \(\frac {\frac {4 x}{a}-\frac {6 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}+\frac {6 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{a d}-\frac {8 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a}+\frac {4 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{a}+\frac {2 i \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{a d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2} a^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}+\frac {4 i \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d \,a^{3}}+\frac {4 i \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d \,a^{3}}-\frac {4 i \ln \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )}{d \,a^{3}}\) \(194\)

[In]

int(sec(d*x+c)^3/(cos(d*x+c)*a+I*a*sin(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d/a^3*(-3*tan(d*x+c)+1/2*I*tan(d*x+c)^2-4*I*ln(tan(d*x+c)-I))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 113, normalized size of antiderivative = 1.51 \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=\frac {2 \, {\left (4 \, d x e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, d x + 2 \, {\left (4 \, d x - i\right )} e^{\left (2 i \, d x + 2 i \, c\right )} - 2 \, {\left (-i \, e^{\left (4 i \, d x + 4 i \, c\right )} - 2 i \, e^{\left (2 i \, d x + 2 i \, c\right )} - i\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) - 3 i\right )}}{a^{3} d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, a^{3} d e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3} d} \]

[In]

integrate(sec(d*x+c)^3/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x, algorithm="fricas")

[Out]

2*(4*d*x*e^(4*I*d*x + 4*I*c) + 4*d*x + 2*(4*d*x - I)*e^(2*I*d*x + 2*I*c) - 2*(-I*e^(4*I*d*x + 4*I*c) - 2*I*e^(
2*I*d*x + 2*I*c) - I)*log(e^(2*I*d*x + 2*I*c) + 1) - 3*I)/(a^3*d*e^(4*I*d*x + 4*I*c) + 2*a^3*d*e^(2*I*d*x + 2*
I*c) + a^3*d)

Sympy [F]

\[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=\frac {\int \frac {\sec ^{3}{\left (c + d x \right )}}{- i \sin ^{3}{\left (c + d x \right )} - 3 \sin ^{2}{\left (c + d x \right )} \cos {\left (c + d x \right )} + 3 i \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )} + \cos ^{3}{\left (c + d x \right )}}\, dx}{a^{3}} \]

[In]

integrate(sec(d*x+c)**3/(a*cos(d*x+c)+I*a*sin(d*x+c))**3,x)

[Out]

Integral(sec(c + d*x)**3/(-I*sin(c + d*x)**3 - 3*sin(c + d*x)**2*cos(c + d*x) + 3*I*sin(c + d*x)*cos(c + d*x)*
*2 + cos(c + d*x)**3), x)/a**3

Maxima [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 301 vs. \(2 (67) = 134\).

Time = 0.32 (sec) , antiderivative size = 301, normalized size of antiderivative = 4.01 \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=-\frac {2 \, {\left (4 i \, d x + 2 \, {\left (-i \, \cos \left (4 \, d x + 4 \, c\right ) - 2 i \, \cos \left (2 \, d x + 2 \, c\right ) + \sin \left (4 \, d x + 4 \, c\right ) + 2 \, \sin \left (2 \, d x + 2 \, c\right ) - i\right )} \arctan \left (\sin \left (2 \, d x + 2 \, c\right ), \cos \left (2 \, d x + 2 \, c\right ) + 1\right ) + 4 \, {\left (i \, d x + i \, c\right )} \cos \left (4 \, d x + 4 \, c\right ) + 2 \, {\left (4 i \, d x + 4 i \, c + 1\right )} \cos \left (2 \, d x + 2 \, c\right ) - {\left (\cos \left (4 \, d x + 4 \, c\right ) + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + i \, \sin \left (4 \, d x + 4 \, c\right ) + 2 i \, \sin \left (2 \, d x + 2 \, c\right ) + 1\right )} \log \left (\cos \left (2 \, d x + 2 \, c\right )^{2} + \sin \left (2 \, d x + 2 \, c\right )^{2} + 2 \, \cos \left (2 \, d x + 2 \, c\right ) + 1\right ) - 4 \, {\left (d x + c\right )} \sin \left (4 \, d x + 4 \, c\right ) - 2 \, {\left (4 \, d x + 4 \, c - i\right )} \sin \left (2 \, d x + 2 \, c\right ) + 4 i \, c + 3\right )}}{{\left (-i \, a^{3} \cos \left (4 \, d x + 4 \, c\right ) - 2 i \, a^{3} \cos \left (2 \, d x + 2 \, c\right ) + a^{3} \sin \left (4 \, d x + 4 \, c\right ) + 2 \, a^{3} \sin \left (2 \, d x + 2 \, c\right ) - i \, a^{3}\right )} d} \]

[In]

integrate(sec(d*x+c)^3/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x, algorithm="maxima")

[Out]

-2*(4*I*d*x + 2*(-I*cos(4*d*x + 4*c) - 2*I*cos(2*d*x + 2*c) + sin(4*d*x + 4*c) + 2*sin(2*d*x + 2*c) - I)*arcta
n2(sin(2*d*x + 2*c), cos(2*d*x + 2*c) + 1) + 4*(I*d*x + I*c)*cos(4*d*x + 4*c) + 2*(4*I*d*x + 4*I*c + 1)*cos(2*
d*x + 2*c) - (cos(4*d*x + 4*c) + 2*cos(2*d*x + 2*c) + I*sin(4*d*x + 4*c) + 2*I*sin(2*d*x + 2*c) + 1)*log(cos(2
*d*x + 2*c)^2 + sin(2*d*x + 2*c)^2 + 2*cos(2*d*x + 2*c) + 1) - 4*(d*x + c)*sin(4*d*x + 4*c) - 2*(4*d*x + 4*c -
 I)*sin(2*d*x + 2*c) + 4*I*c + 3)/((-I*a^3*cos(4*d*x + 4*c) - 2*I*a^3*cos(2*d*x + 2*c) + a^3*sin(4*d*x + 4*c)
+ 2*a^3*sin(2*d*x + 2*c) - I*a^3)*d)

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.71 \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=\frac {2 \, {\left (\frac {2 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right )}{a^{3}} - \frac {4 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}{a^{3}} + \frac {2 i \, \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right )}{a^{3}} + \frac {-3 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 7 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 i}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} a^{3}}\right )}}{d} \]

[In]

integrate(sec(d*x+c)^3/(a*cos(d*x+c)+I*a*sin(d*x+c))^3,x, algorithm="giac")

[Out]

2*(2*I*log(tan(1/2*d*x + 1/2*c) + 1)/a^3 - 4*I*log(tan(1/2*d*x + 1/2*c) - I)/a^3 + 2*I*log(tan(1/2*d*x + 1/2*c
) - 1)/a^3 + (-3*I*tan(1/2*d*x + 1/2*c)^4 + 3*tan(1/2*d*x + 1/2*c)^3 + 7*I*tan(1/2*d*x + 1/2*c)^2 - 3*tan(1/2*
d*x + 1/2*c) - 3*I)/((tan(1/2*d*x + 1/2*c)^2 - 1)^2*a^3))/d

Mupad [B] (verification not implemented)

Time = 23.22 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.39 \[ \int \frac {\sec ^3(c+d x)}{(a \cos (c+d x)+i a \sin (c+d x))^3} \, dx=-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-\mathrm {i}\right )\,8{}\mathrm {i}-\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,4{}\mathrm {i}}{a^3\,d}+\frac {6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,2{}\mathrm {i}-6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^3\,d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}^2} \]

[In]

int(1/(cos(c + d*x)^3*(a*cos(c + d*x) + a*sin(c + d*x)*1i)^3),x)

[Out]

(tan(c/2 + (d*x)/2)^2*2i - 6*tan(c/2 + (d*x)/2) + 6*tan(c/2 + (d*x)/2)^3)/(a^3*d*(tan(c/2 + (d*x)/2)^2 - 1)^2)
 - (log(tan(c/2 + (d*x)/2) - 1i)*8i - log(tan(c/2 + (d*x)/2)^2 - 1)*4i)/(a^3*d)